const isTabActive = () => !document.hidden;
console.log(isTabActive());